﻿<phone:PhoneApplicationPage 
    x:Class="Studio77.RuneMaster.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="False">
	<phone:PhoneApplicationPage.Resources>
		<Style x:Key="ButtonStyle1" TargetType="Button">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Grid>
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Pressed">
										<Storyboard>
											<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="contentPresenter" d:IsOptimized="True"/>
											<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="contentPresenter" d:IsOptimized="True"/>
											<DoubleAnimation Duration="0" To="1.05" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="border" d:IsOptimized="True"/>
											<DoubleAnimation Duration="0" To="1.05" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="contentPresenter" d:IsOptimized="True"/>
											<DoubleAnimation Duration="0" To="1.05" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="border" d:IsOptimized="True"/>
											<DoubleAnimation Duration="0" To="1.05" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="contentPresenter" d:IsOptimized="True"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="Disabled">
										<Storyboard>
											<DoubleAnimation Duration="0" To="0.3" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="contentPresenter" d:IsOptimized="True"/>
											<ColorAnimation Duration="0" To="#FF6C6C6C" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="MouseOver"/>
								</VisualStateGroup>
								<VisualStateGroup x:Name="FocusStates">
									<VisualState x:Name="Focused"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Border x:Name="border" BorderBrush="#FF402300" BorderThickness="2" HorizontalAlignment="Left" Height="51" VerticalAlignment="Top" Width="204" CornerRadius="7" RenderTransformOrigin="0.5,0.5">
								<Border.RenderTransform>
									<CompositeTransform/>
								</Border.RenderTransform>
								<Border.Background>
									<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
										<GradientStop Color="#FFF5B558" Offset="0"/>
										<GradientStop Color="#FF915806" Offset="1"/>
										<GradientStop Color="#FF663D00" Offset="0.168"/>
									</LinearGradientBrush>
								</Border.Background>
							</Border>
							<ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RenderTransformOrigin="0.5,0.5">
								<ContentPresenter.RenderTransform>
									<CompositeTransform/>
								</ContentPresenter.RenderTransform>
							</ContentPresenter>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ButtonStyleSoundOn" TargetType="Button">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Grid>
							<Image Source="Images\sound_on.png" Stretch="Fill"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ButtonStyleMusicOn" TargetType="Button">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Grid>
                            <Image Source="Images\music_on.png" Stretch="Fill"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ButtonStyleSoundOff" TargetType="Button">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Grid>
                            <Image Source="Images\sound_off.png" Stretch="Fill"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ButtonStyleMusicOff" TargetType="Button">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Grid>
                            <Image Source="Images\music_off.png" Stretch="Fill"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ButtonStyle2" TargetType="Button">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Grid>
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Pressed">
										<Storyboard>
											<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="contentPresenter" d:IsOptimized="True"/>
											<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="contentPresenter" d:IsOptimized="True"/>
											<DoubleAnimation Duration="0" To="1.05" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="border" d:IsOptimized="True"/>
											<DoubleAnimation Duration="0" To="1.05" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="contentPresenter" d:IsOptimized="True"/>
											<DoubleAnimation Duration="0" To="1.05" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="border" d:IsOptimized="True"/>
											<DoubleAnimation Duration="0" To="1.05" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="contentPresenter" d:IsOptimized="True"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="Disabled">
										<Storyboard>
											<DoubleAnimation Duration="0" To="0.3" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="contentPresenter" d:IsOptimized="True"/>
											<ColorAnimation Duration="0" To="#FF6C6C6C" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="MouseOver"/>
								</VisualStateGroup>
								<VisualStateGroup x:Name="FocusStates">
									<VisualState x:Name="Focused"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Border x:Name="border" BorderBrush="#FF400000" BorderThickness="2" HorizontalAlignment="Left" Height="51" VerticalAlignment="Top" Width="204" CornerRadius="7" RenderTransformOrigin="0.5,0.5">
								<Border.RenderTransform>
									<CompositeTransform/>
								</Border.RenderTransform>
								<Border.Background>
									<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
										<GradientStop Color="#FFF55858" Offset="0"/>
										<GradientStop Color="#FF910606" Offset="1"/>
										<GradientStop Color="#FF660900" Offset="0.168"/>
									</LinearGradientBrush>
								</Border.Background>
							</Border>
							<ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RenderTransformOrigin="0.5,0.5">
								<ContentPresenter.RenderTransform>
									<CompositeTransform/>
								</ContentPresenter.RenderTransform>
							</ContentPresenter>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ButtonStyleClose" TargetType="Button">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Grid x:Name="grid" RenderTransformOrigin="0.5,0.5">
							<Grid.RenderTransform>
								<CompositeTransform/>
							</Grid.RenderTransform>
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Pressed">
										<Storyboard>
											<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="grid" d:IsOptimized="True"/>
											<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="grid" d:IsOptimized="True"/>
											<DoubleAnimation Duration="0" To="1.05" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="grid" d:IsOptimized="True"/>
											<DoubleAnimation Duration="0" To="1.05" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="grid" d:IsOptimized="True"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="Disabled"/>
									<VisualState x:Name="MouseOver"/>
								</VisualStateGroup>
								<VisualStateGroup x:Name="FocusStates">
									<VisualState x:Name="Focused"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Ellipse Width="37" VerticalAlignment="Top" Stroke="White" Height="37" HorizontalAlignment="Left" Fill="#FF890000"/>
							<Path Width="20.254" VerticalAlignment="Center" UseLayoutRounding="False" StrokeThickness="5" Stroke="White" Stretch="Fill" Height="20.254" HorizontalAlignment="Center" Fill="#FF890000" Data="M265,10 L284.254,29.2542"/>
							<Path Width="20.254" VerticalAlignment="Center" UseLayoutRounding="False" StrokeThickness="5" Stroke="White" Stretch="Fill" RenderTransformOrigin="0.5,0.5" Margin="8.373" Height="20.254" HorizontalAlignment="Center" Fill="#FF890000" Data="M265,10 L284.254,29.2542">
								<Path.RenderTransform>
									<CompositeTransform Rotation="90"/>
								</Path.RenderTransform>
							</Path>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Storyboard x:Name="StoryboardShowNewUser">
			<DoubleAnimation Duration="0:0:0.5" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="bdrNewUser" d:IsOptimized="True">
				<DoubleAnimation.EasingFunction>
					<ExponentialEase EasingMode="EaseIn"/>
				</DoubleAnimation.EasingFunction>
			</DoubleAnimation>
		</Storyboard>
		<Storyboard x:Name="StoryboardHideNewUser">
			<DoubleAnimation Duration="0:0:0.5" To="-800" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="bdrNewUser" d:IsOptimized="True">
				<DoubleAnimation.EasingFunction>
					<ExponentialEase EasingMode="EaseOut"/>
				</DoubleAnimation.EasingFunction>
			</DoubleAnimation>
		</Storyboard>
	</phone:PhoneApplicationPage.Resources>

    <!--LayoutRoot 是包含所有页面内容的根网格-->
    <Viewbox>
		<Grid x:Name="LayoutRoot" Background="Transparent" Height="800" Width="480">
			<Image Source="/Images/mainbg.png" Stretch="Fill"/>
			<StackPanel Margin="0,383,0,65" Orientation="Vertical">
				<Button x:Name="btnContinue" Click="btnContinue_Click_1" Content="CONTINUE" Height="51" Style="{StaticResource ButtonStyle1}" Width="204" HorizontalAlignment="Center" Background="White"/>
				<Button x:Name="btnNewGame" Click="btnNewGame_Click_1" Content="NEW GAME" Height="51" VerticalAlignment="Top" Background="White" HorizontalAlignment="Center" Width="204" Style="{StaticResource ButtonStyle1}" BorderThickness="0" Margin="0,40,0,0"/>
				<Button x:Name="btnGameRecord" Click="btnGameRecord_Click_1" Content="SCORE" Height="51" VerticalAlignment="Top" Background="White" HorizontalAlignment="Center" Width="204" Style="{StaticResource ButtonStyle1}" BorderThickness="0" Margin="0,40,0,0"/>
				<Button x:Name="btnNewUser" Content="GIFT PACKAGE" Height="51" VerticalAlignment="Top" Background="White" HorizontalAlignment="Center" Width="204" Style="{StaticResource ButtonStyle2}" BorderThickness="0" Margin="138,40,138,0"/>
       
			</StackPanel>
			<TextBlock HorizontalAlignment="Center" Margin="0,0,0,5" TextWrapping="Wrap" Text="77GAME Presents 2013" VerticalAlignment="Bottom" Foreground="White"/>
			<Button x:Name="btnSoundOn" Content="Button" Height="50" Margin="10,0,420,10" Style="{StaticResource ButtonStyleSoundOn}" VerticalAlignment="Bottom" Width="50" Click="btnSoundOn_Click"/>
			<Button x:Name="btnMusicOn" Content="Button" HorizontalAlignment="Right" Height="50" Margin="0,0,362,10" Style="{StaticResource ButtonStyleMusicOn}" VerticalAlignment="Bottom" Width="50" Click="btnMusicOn_Click"/>
			<Button x:Name="btnSoundOff" Content="Button" Height="50" Margin="10,0,420,10" Style="{StaticResource ButtonStyleSoundOff}" VerticalAlignment="Bottom" Width="50" Visibility="Collapsed" Click="btnSoundOff_Click"/>
			<Button x:Name="btnMusicOff" Content="Button" HorizontalAlignment="Right" Height="50" Margin="0,0,362,10" Style="{StaticResource ButtonStyleMusicOff}" VerticalAlignment="Bottom" Width="50" Visibility="Collapsed" Click="btnMusicOff_Click"/>
			<TextBlock HorizontalAlignment="Center" Margin="2,358,0,0" TextWrapping="Wrap" Text="{Binding Text, ElementName=txtLastRecord}" VerticalAlignment="Top" Foreground="White" FontFamily="Segoe WP Semibold" Visibility="{Binding Visibility, ElementName=txtLastRecord}"/>
			<TextBlock x:Name="txtLastRecord" HorizontalAlignment="Center" Margin="0,357,0,0" TextWrapping="Wrap" Text="EASY 2-2" VerticalAlignment="Top" Foreground="Red" FontFamily="Segoe WP Semibold"/>
			<Border x:Name="bdrNewUser" BorderBrush="Black" BorderThickness="1" Margin="0" Background="#CC000000" RenderTransformOrigin="0.5,0.5">
				<Border.RenderTransform>
					<CompositeTransform TranslateY="-800"/>
				</Border.RenderTransform>
				<Border BorderBrush="White" BorderThickness="1" HorizontalAlignment="Center" Height="358" VerticalAlignment="Center" Width="300" Background="#7FE8E8E8" CornerRadius="10">
					<Grid>
						<Image Source="coins1.png" Stretch="Fill" HorizontalAlignment="Center" Width="89" Height="89" VerticalAlignment="Top" Margin="0,10,0,0"/>
						<TextBlock HorizontalAlignment="Center" Margin="20,114,20,0" TextWrapping="Wrap" Text="Rate game with 5 stars" VerticalAlignment="Top" Foreground="#FFFFE800" FontSize="24"/>
						<TextBlock HorizontalAlignment="Center" Margin="0,162,0,0" TextWrapping="Wrap" Text="get free 50,000 G" VerticalAlignment="Top" Foreground="#FFFFE800" FontSize="24"/>
						<Button x:Name="btnGetCoin" Content="Get It!" HorizontalAlignment="Center" Margin="47,275,47,0" VerticalAlignment="Top" Style="{StaticResource ButtonStyle2}"/>
						<Button x:Name="btnCloseNewUser" Content="Button" Margin="256,3,5,316" Style="{StaticResource ButtonStyleClose}"/>
					</Grid>
				</Border>
			</Border>
       
		</Grid>
 
	</Viewbox>
 
</phone:PhoneApplicationPage>